import{ createRouter, createWebHistory } from 'vue-router'
import HomeView  from "@/views/AdminView.vue";

const router = createRouter(
{

    history: createWebHistory(import.meta.env.BASE_URL),
    routes:[
        {path: '/',redirect:'/manager/home'},
        { path: '/login', component: () => import('@/views/userlogin/Login.vue') },
        { path: '/register', component: () => import('@/views/userlogin/Register.vue') },
        {path: '/manager', name: 'manager', component: () =>import('../views/Manager.vue'),
            children:[
                {path: 'home',meta: {name: '首页'}, component: () => import('../views/HomeView.vue'),},
                {path: 'admin', meta: {name: '管理员信息'},component: () => import('../views/AdminView.vue'),},
                {path: 'about', meta: '关于用户',component: () => import('../views/AboutView.vue'),},
                {path: 'class', meta: {name: '班级管理'},component: () => import('../views/Class.vue'),},
                {path: 'teacher', meta: {name: '教师管理'},component: () => import('../views/teacher.vue'),},
                {path: 'student', meta: {name: '学生管理'},component: () => import('../views/student.vue'),},

            ]

        },

        {path: '/notFound', name: 'notFound', component: () => import('../views/404.vue'),},
        {path: '/:pathMach(.*)', redirect:"/notFound"},

    ],
})
export default router
